<template>
  <div id="app">
    <AkButton 
      text="展示lay"
      inline
      round
      @click="clickBtnHandler"
    />
    <ak-button 
      text="展示popup"
      type="danger"
      inline
      @click="clickBtnHandler2"
    />

    <AkOverlay :show.sync="showLay" @click-overlay="clickLayHandler">
      <p v-if="showLay" class="lay-fun">funny</p>
    </AkOverlay>

    <AkPopup :show.sync="showPopup" :persistent="persistent" @click-overlay="clickOutside">
      <p>这又意思</p>
    </AkPopup>
  </div>
</template>

<script>
export default {
  name: 'App',
  data () {
    return {
      showLay: false,
      showPopup: false,
      persistent: false
    }
  },
  methods: {
    clickBtnHandler () {
      this.showLay = true
    },
    clickBtnHandler2 () {
      this.showPopup = true
    },
    clickLayHandler () {
      console.log('click lay')
    },
    clickOutside () {
      console.log('click popup overlay')
    }
  }
}
</script>

<style lang="less">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
  .lay-fun {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    z-index: 10;
  }
}
</style>
